﻿@model ExamPlat.Models.UserInfo
@{
    ViewBag.Title = "Edit";
}

<div>@Html.ActionLink("返回列表", "Index", new { loginAccount = ViewBag.SearchAccount, userName = ViewBag.SearchName })</div>
<form action="Edit" method="post">
    @Html.HiddenFor(Model => Model.ID)
    <div class="editor-label">
        @Html.LabelFor(Model => Model.LoginAccount)
    </div>
    <div class="editor-field">
        @Html.EditorFor(Model => Model.LoginAccount)
        @Html.ValidationMessageFor(Model => Model.LoginAccount)
    </div>
    <div class="editor-label">
        @Html.LabelFor(Model => Model.LoginPwd)
    </div>
    <div class="editor-field">
        @Html.EditorFor(Model => Model.LoginPwd)
        @Html.ValidationMessageFor(Model => Model.LoginPwd)
    </div>
    <div class="editor-label">
        @Html.LabelFor(Model => Model.UserName)
    </div>
    <div class="editor-field">
        @Html.EditorFor(Model => Model.UserName)
        @Html.ValidationMessageFor(Model => Model.UserName)
    </div>
    <div class="editor-label">
        @Html.LabelFor(Model => Model.RoleID)
    </div>
    <div class="editor-field">
        <select id="selRoleID" name="RoleID" style="width:160px;">
            @{
                if (Model.RoleID == 2)
                {
                    <option value="2" selected="selected">考生</option>
                }
                else
                {
                    <option value="2">考生</option>
                }
                if (Model.RoleID == 1)
                {
                    <option value="1" selected="selected">管理员</option>
                }
                else
                {
                    <option value="1">管理员</option>
                }
            }
        </select>
    </div>
    <div style="margin-top:10px; "><input type="submit" value="保存" class="btn btn-primary" /></div>
    <div class="msg">@ViewBag.Msg</div>
    <div><input type="hidden" name="searchLoginAccount" value="@ViewBag.SearchAccount" /></div>
    <div><input type="hidden" name="searchUserName" value="@ViewBag.SearchName" /></div>
</form>